<template>
  <el-dialog v-model="dialogAddrVisible" :title="$t('smt.Shippingaddress')" width="1200px">
    <ShippingAddress
      style="padding-bottom: 20px"
      v-if="props.addressList"
      :addMsg="props.title"
      :addAddressList="props.addressList"
      @getAddressList="getAddressList"
      @selected="onSelected"
      :tableSelection="true"
      ref="childRef"
    />
  </el-dialog>
</template>
<script setup>
import { ref, reactive, onMounted } from 'vue';
import ShippingAddress from '@/components/ShippingAddress/index.vue';

const props = defineProps({
  title: {
    type: String,
  },
  addressList: {
    type: Array,
  },
  pcbOrderId: {
    type: String,
  },
});

const emit = defineEmits(['getAddressList', 'selected', 'cacnel']);

const dialogAddrVisible = ref(false);
let childRef = ref(null);

/**
 * 获取选中信息
 */
const onSelected = (data) => {
  emit('selected', data);
};

/**
 * 获取地址列表
 */
const getAddressList = (type = 1) => {
  emit('getAddressList', type);
};

onMounted(() => {});
</script>
